*************************
** Country-Year Models **
*************************

*TABLE 2
*t-1
xtreg F.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_1_light

xtreg F.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign camp_size3 sec_defect3 diversity_all totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_1

estout t_1_light t_1, keep( iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign camp_size3 sec_defect3 diversity_allyrs totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbanization v2x_polyarchy) cells(b(star fmt(%9.3f)) p(par)) stats(r2 N) 

*FIGURE 3, Coefficient Plots
*t-1
xtreg F.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign  camp_size3 sec_defect3 diversity_all totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_1
*t-2

xtreg F2.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign  camp_size3 sec_defect3 diversity_all F.totalviolentconflicts_loc F.neighbordemocracy F.lngdppc F.lntpop F.urbaniz F.v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_2

*t-5
xtreg F5.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign camp_size3 sec_defect3 diversity_all F4.totalviolentconflicts_loc F4.neighbordemocracy F4.lngdppc F4.lntpop F4.urbaniz F4.v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_5

*t-10
xtreg F10.v2x_polyarchy iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign camp_size3 sec_defect3 diversity_all F9.totalviolentconflicts_loc F9.neighbordemocracy F9.lngdppc F9.lntpop F9.urbaniz F9.v2x_polyarchy i.year if campaign_status != 7  & year < 2014, fe cluster(ccode) r
estimates store t_10

coefplot t_1 t_2 t_5 t_10, keep(iprogress4 iprogress3 iprogress2 iprogress1 ongoing_campaign camp_size3 sec_defect3 diversity_allyrs) xline(0) coeflabels(iprogress4 = "Full Success" iprogress3 = "Major Concessiosn" iprogress2 = "Verbal Concessions" iprogress1 = "Nonverbal Allowarnces" ongoing_campaign = "Ongoing Campaign" camp_size3 = "Campaign Size" sec_defect3 = "Security Defections" diversity_allyrs = "Campaign Diversity") legend(label(1 "t-1")label(2 "t-2")label(3 "t-5")label(4 "t-10"))

*******************************
** Post-Campaign-Year Models **
*******************************

*FIGURE 4, Coefficient Plot
*t-1
reg v2x_polyarchy outcomespelltype_p camp_size_spell camp_sec_defect_spell camp_diversity_spell totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz polyarchy_at_start L.v2x_polyarchy if postcampyears == 1 & year < 2014 & outcomespelltype != 6, r cluster(ccode)
estimates store t_1

*t-2
reg v2x_polyarchy outcomespelltype_p camp_size_spell camp_sec_defect_spell camp_diversity_spell totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz polyarchy_at_start L.v2x_polyarchy if postcampyears == 2 & year < 2014 & outcomespelltype != 6, r cluster(ccode)
estimates store t_2

*t-5
reg v2x_polyarchy outcomespelltype_p camp_size_spell camp_sec_defect_spell camp_diversity_spell totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz polyarchy_at_start L.v2x_polyarchy if postcampyears == 5 & year < 2014 & outcomespelltype != 6, r cluster(ccode)
estimates store t_5

*t-10
reg v2x_polyarchy outcomespelltype_p camp_size_spell camp_sec_defect_spell camp_diversity_spell totalviolentconflicts_loc neighbordemocracy lngdppc lntpop urbaniz polyarchy_at_start L.v2x_polyarchy if postcampyears == 10 & year < 2014 & outcomespelltype != 6, r cluster(ccode)
estimates store t_10

estout t_1 t_2 t_5 t_10, cells(b(star fmt(%9.3f)) p(par)) stats(r2 N) 

coefplot t_1 t_2 t_5 t_10, level(90) keep(outcomespelltype_posdemob camp_size_spell camp_sec_defect_spell camp_diversity_spell) xline(0)  coeflabels( outcomespelltype_posdemob = "Positive Demobilization" camp_size_spell = "Campaign Size" camp_sec_defect_spell = "Security Defections" camp_diversity_spell = "Campaign Diversity" totalviolentconflicts_loc = "# Violent Conflicts" neighbordemocracy =  "Neighborhood Democracy" lngdppc = "GDP per capita (logged)" lntpop = "Population (logged)" urbanization = "Urbanization" polyarchy_at_start = "Polyarchy @ Campaign Start" )